#include "myCircle.h"

void Circle::WhereAmI()
{
	std::cout << "Now I am in class Circle" << std::endl;
}

void Circle::WhereAmIVirtual()
{
	std::cout << "Now I am in class Circle" << std::endl;
}

Circle::Circle(double x, double y, double radius, colour colour, bool contour, double transparency)
	:Shape(colour, contour, transparency)//�������� ���������� ������������ �������� ������
{
	m_x = x;
	m_y = y;
	m_radius = radius;
}

Circle::Circle(const Circle& other)
	:Shape(other)//�r������ ����� ������������� �������� ������ ���������������� ������� �����
{
	m_x = other.m_x;
	m_y = other.m_y;
	m_radius = other.m_radius;
}

Circle::Circle(const Rect& rect)
	:Shape(rect)//�r������ ����� ������������� �������� ������ ���������������� ������� �����
{
	int tmp_left, tmp_right, tmp_top, tmp_bottom;
	rect.GetAll(tmp_left, tmp_right, tmp_top, tmp_bottom);
	m_x = (tmp_right + tmp_left)/2;
	m_y = (tmp_bottom + tmp_top)/2;
	
	if ((tmp_right - tmp_left) < (tmp_bottom - tmp_top))
	{
		m_radius = (tmp_right - tmp_left) / 2;
	}
	else { m_radius = (tmp_bottom - tmp_top) / 2; }
}

void Circle::Inflate(int inflate)
{
	m_radius += inflate / 2;
}

Circle::~Circle()
{
	std::cout << "Now I am in Circle's destructor!" << std::endl;
}
